Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard
data class CalendarDate(val year: Int?, val month: Month, val day: Int, val weekdayOffset: WeekdayOffset? = null, val dayOffset: Int = 0) : Date

A date consisting of an optional year, a day, month and an optional weekdayOffset,

Link copied to clipboard
data class ClockTime(val hour: Int, val minutes: Int = 0) : Time, Interval

A hour:minutes time as seen on a 24-hour clock

Link copied to clipboard
sealed interface Date : MonthsOrDateSelector
Link copied to clipboard
data class DateRange(val start: Date, val end: Date) : MonthsOrDateSelector

Within a range of dates (start-end)

Link copied to clipboard
data class DatesInMonth(val year: Int?, val month: Month, val days: List<MonthDaySelector>) : MonthsOrDateSelector

Several days within one month

Link copied to clipboard

The time of a daily event (e.g. sunrise)

Link copied to clipboard
data class ExtendedClockTime(val hour: Int, val minutes: Int = 0) : ExtendedTime

A hour:minutes time as seen on a 48-hour clock, lol

Link copied to clipboard
sealed interface ExtendedTime
Link copied to clipboard
Link copied to clipboard
sealed interface HolidaySelector
Link copied to clipboard
data class HolidayWithOffset(val holiday: Holiday, val dayOffset: Int) : HolidaySelector

At a holiday with dayOffset, e.g. 1 day before a public holiday

Link copied to clipboard
sealed interface Interval
Link copied to clipboard
value class IntervalMinutes(val minutes: Int) : Interval

Time interval specified in minutes

Link copied to clipboard
data class LastNth(val nth: Int) : NthPointSelector

Only the last nth of something, e.g. the 2nd last Sunday of a month

Link copied to clipboard
enum Month : Enum<Month>

Single month. The ordinal 0 is January.

Link copied to clipboard
data class MonthDay(val day: Int) : MonthDaySelector
Link copied to clipboard
data class MonthDayRange(val start: Int, val end: Int) : MonthDaySelector
Link copied to clipboard
sealed interface MonthDaySelector
Link copied to clipboard
data class MonthRange(val year: Int? = null, val start: Month, val end: Month) : MonthsOrDateSelector

Within range of months (start-end)

Link copied to clipboard
sealed interface MonthsOrDateSelector
Link copied to clipboard
data class NextWeekday(val weekday: Weekday) : WeekdayOffset

Offset to next weekday

Link copied to clipboard
value class Nth(val nth: Int) : NthPointSelector

The nth of something. E.g. the 4th Sunday in a month

Link copied to clipboard
sealed interface NthPointSelector : NthSelector
Link copied to clipboard
data class NthRange(val start: Int, val end: Int) : NthRangeSelector

Range of nths, e.g. only the first and second Sunday of a month

Link copied to clipboard
sealed interface NthRangeSelector : NthSelector
Link copied to clipboard
sealed interface NthSelector
Link copied to clipboard
Link copied to clipboard
data class OpeningHours(val rules: List<Rule>)

Model for opening hours according to the specification at https://wiki.openstreetmap.org/wiki/Key:opening_hours/specification

Link copied to clipboard
data class PreviousWeekday(val weekday: Weekday) : WeekdayOffset

Offset to next weekday

Link copied to clipboard
data class Range(val years: List<YearsSelector>? = null, val months: List<MonthsOrDateSelector>? = null, val weeks: List<WeeksSelector>? = null, val text: String? = null, val useSeparatorForReadability: Boolean? = null, val weekdays: List<WeekdaysSelector>? = null, val holidays: List<HolidaySelector>? = null, val isRestrictedByHolidays: Boolean = false, val times: List<TimesSelector>? = null) : Selector

At a certain time of year(s), months, weeks, weekdays, times.

Link copied to clipboard
data class Rule(val selector: Selector, val ruleType: RuleType? = null, val comment: String? = null, val ruleOperator: RuleOperator = RuleOperator.Normal)

Specifies the times via selector at which it is open/closed/unknown (see ruleType) with optional comment. ruleOperator determines whether this rule should add to, overwrite the previous rule etc.

Link copied to clipboard
Link copied to clipboard

Specifies what the selector specifies: The times when it is open, or closed, or ...

Link copied to clipboard
sealed interface Selector
Link copied to clipboard
data class SingleMonth(val year: Int?, val month: Month) : MonthsOrDateSelector

A single month, optionally in a specific year

Link copied to clipboard
data class SpecificWeekdayDate(val year: Int?, val month: Month, val weekday: Weekday, val nthPointSelector: NthPointSelector, val dayOffset: Int = 0) : Date

A date consisting of optional year, month and a specific weekday

Link copied to clipboard
data class SpecificWeekdays(val weekday: Weekday, val nths: List<NthSelector>, val dayOffset: Int = 0) : WeekdaysSelector

At a specific weekday (s) within a month: Only the nths weekday. E.g. only the second Sunday. Optionally, moreover specify an offset to that. E.g. only the day after the second Sunday.

Link copied to clipboard
data class StartingAtDate(val start: Date) : MonthsOrDateSelector

Since a start date with an optional offset

Link copied to clipboard
data class StartingAtTime(val start: Time) : TimeSpansSelector

From start time with open end

Link copied to clipboard
data class StartingAtYear(val start: Int) : YearsSelector

Since the start year

Link copied to clipboard
Link copied to clipboard
data class TimeIntervals(val start: Time, val end: ExtendedTime, val step: Interval) : TimePointsSelector

At intervals of the given step in-between the time range from start to end.

Link copied to clipboard
data class TimeOffset(val op: OffsetOp, val offset: ClockTime)
Link copied to clipboard
Link copied to clipboard
data class TimeSpan(val start: Time, val end: ExtendedTime, val openEnd: Boolean = false) : TimeSpansSelector

From start to end time, optionally with open end

Link copied to clipboard
sealed interface TimeSpansSelector : TimesSelector
Link copied to clipboard
sealed interface TimesSelector
Link copied to clipboard

Always

Link copied to clipboard
data class VariableDate(val year: Int?, val annualEvent: AnnualEvent, val weekdayOffset: WeekdayOffset? = null, val dayOffset: Int = 0) : Date

An annualEvent, optionally in a specific year and optional offsets

Link copied to clipboard
data class VariableTime(val dailyEvent: EventTime, val timeOffset: TimeOffset? = null) : Time

The time of a daily event (e.g. sunrise) plus/minus an offset (e.g. 1 hour after sunrise)

Link copied to clipboard
value class Week(val week: Int) : WeeksSelector

A single week

Link copied to clipboard

A single weekday. The ordinal 0 is Monday.

Link copied to clipboard
sealed interface WeekdayOffset
Link copied to clipboard
data class WeekdayRange(val start: Weekday, val end: Weekday) : WeekdaysSelector

Within a range of weekdays (start-end), may loop over the end of the week

Link copied to clipboard
sealed interface WeekdaysSelector
Link copied to clipboard
data class WeekRange(val start: Int, val end: Int, val step: Int? = null) : WeeksSelector

Within a range of weeks (start-end) with an optional interval of step weeks. E.g. from week 12 to week 40 but only every second week

Link copied to clipboard
sealed interface WeeksSelector
Link copied to clipboard
value class Year(val year: Int) : YearsSelector

A single year

Link copied to clipboard
data class YearRange(val start: Int, val end: Int, val step: Int? = null) : YearsSelector

Within a range of years (start-end) with an optional interval of step years. E.g. between 2014-2024 but only every 2nd year

Link copied to clipboard
sealed interface YearsSelector